<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateSettingSysgiftAllocateTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('setting_allocate', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->unsignedTinyInteger('male_cate')->default(0)->comment('男用户分类');
            $table->string('male_uids', 1000)->default('')->comment('男用户ID组');
            $table->unsignedTinyInteger('host_cate')->default(0)->comment('主播分类');
            $table->string('host_uids', 1000)->default('')->comment('主播ID组');
            $table->unsignedTinyInteger('allocate_type')->default(1)->comment('分配类型：1-礼物');
            $table->unsignedTinyInteger('priority')->default(1)->comment('优先级：越高越优先，最高255');
            $table->unsignedSmallInteger('gift_id')->default(0)->comment('分配对应的礼物ID');
            $table->unsignedInteger('gift_num')->default(0)->comment('礼物最大限制数量');
            $table->unsignedSmallInteger('single_gift_num')->default(0)->comment('单次上线推送的礼物数量');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('记录状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('setting_allocate');
    }
}
